<?php
require_once 'pages/TMSFrontPage.inc';

class TMSFrontVCardPage extends TMSFrontPage {
	public function Handle(THttpRequest $request){
		header('Content-Type:text/vcard;charset=utf-8;');
		header('Content-Disposition: attachment;filename="'.$this->SiteName.'.vcf"');
echo "BEGIN:VCARD
VERSION:3.0
FN;CHARSET=utf-8:".$this->VCardFullName."
N;CHARSET=utf-8:".$this->VCardName."
ADR;CHARSET=utf-8;TYPE=dom:".$this->VCardInBox.";".$this->VCardOffice.";".$this->VCardStreet.";".$this->VCardCity.";".$this->VCardRegion.";".$this->VCardPostalCode.";".$this->VCardCountry."
TEL;TYPE=work:".$this->VCardPhone."
EMAIL;TYPE=INTERNET:".$this->VCardEmail."
ORG;CHARSET=utf-8:".$this->Company."
".($this->VCardGeo?("GEO:".$this->VCardGeo."
"):"")."URL:".$this->Application()->Url(null,array(),null,true)."
END:VCARD";	
		die;	
	}
}